package com.cloudlinkscm.base.filecenter.common;

import com.cloudlinkscm.base.filecenter.model.dto.RequestAuthenticationDto;
import com.cloudlinkscm.loms.framework.util.MD5Utils;

/**
 * 文件中心提供的工具类
 *
 * @author : tac
 * @date : 2017/7/25
 */
public abstract class FileCenterUtil {
    /**
     * 计算签名
     * @return
     */
    public static String calculateSign(RequestAuthenticationDto dto, String authCode){
        StringBuilder sb = new StringBuilder();
        sb.append(dto.getId());
        sb.append("&");
        sb.append(dto.getTimestamp());
        sb.append("&");
        sb.append(authCode);
        return MD5Utils.encrypt(sb.toString());
    }
}
